﻿
Imports Moca.Db

Namespace Db.Impl

    ''' <summary>
	''' DaoCommon データアクセス
	''' </summary>
    ''' <remarks></remarks>
    Public Class DaoCommon
		Inherits AbstractDao
		Implements IDaoCommon

		Public Sub Setup(mail As String, password As String) Implements IDaoCommon.Setup
			Const C_SQL As String = "IDaoCommon_Setup"

			Using cmd As IDbCommandStoredProcedure = CreateCommandStoredProcedure(C_SQL)
				cmd.AddParameterValue(password)
				cmd.AddParameterValue(mail)

				cmd.ExecuteNonQuery()
			End Using
		End Sub

		Public Function GetRole() As Moca.ConstantDataSet.ConstantDataTable Implements IDaoCommon.GetRole
			Const C_SQL As String = "IDaoCommon_GetRole"

			Using cmd As IDbCommandStoredProcedure = CreateCommandStoredProcedure(C_SQL)
				cmd.Execute()

				Return cmd.ResultConstantDataSet(1, 0).Constant
			End Using
		End Function

	End Class

End Namespace
